<template>
    <div>
      <h2>{{ goodName }}</h2>
      <p>{{ goodDesc }}</p>
      <p>
        <button @click="decrement(id)">-</button>总共{{ num }}个<button
          @click="increment(id)"
        >
          +
        </button>
      </p>
    </div>
  </template>
  
  <script>
  export default {
    name: "Item",
    props: ["goodName", "goodDesc", "id", "num", "increment", "decrement"],
  
    mounted() {
      // console.log(this, "item");
    },
  };
  </script>
  
  <style></style>
  